package com.example.jpatest.repository;

import com.example.jpatest.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

/**
 * 学生repo
 * @author czx
 */
public interface StudentRepository extends JpaRepository<Student,Long> {

    /**
     * 通过学号查找
     */
    Optional<Student> findByStudentNumber(String studentNumber);

    /**
     * 通过学号删除
     */
    Optional<Student> deleteByStudentNumber(String studentNumber);
}
